{
	template:`
	<a-page-header title="流程环节链接">
		<template #extra>
			<a-button type="primary" @click="save();">保存</a-button>
			<m-back @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col :span="24">
						<a-form-item label="环节" class="index-form-item">
							{{link.fromSection.name}}({{link.fromSection.identity}})
						</a-form-item>
					</a-col>
					<a-col :span="24">
						<a-form-item label="下一步" class="index-form-item">
							<a-radio-group v-model:value="link.isNext" :options="dictOptions('flow.model.FlowSectionLink!isNext')"></a-radio-group>
						</a-form-item>
					</a-col>
					<a-col v-if="link.isNext=='Y'||link.isNext=='B'" :span="24">
						<a-form-item label="下一环节" class="index-form-item">
							<a-select v-model:value="link.toSection.oid" :options="nextList" placeholder="请选择下一环节" show-search :filter-option="selectFilter"/>
						</a-form-item>
					</a-col>
					<a-col v-if="link.isNext=='Y'||link.isNext=='N'" :span="12">
						<a-form-item label="参数" class="index-form-item">
							<a-input v-model:value="link.toParam" placeholder="请输入参数"/>
						</a-form-item>
					</a-col>
					<a-col :span="link.isNext=='B'?24:12">
						<a-form-item label="描述" class="index-form-item">
							<a-input v-model:value="link.toDesc" placeholder="请输入描述"/>
						</a-form-item>
					</a-col>
					<a-col v-if="link.isNext=='Y'" :span="24">
						<a-form-item label="选项" class="index-form-item">
							<a-select v-model:value="link.toOption" :options="dictOptions('flow.model.FlowSectionLink!toOption')" placeholder="请选择下一步选项" show-search :filter-option="selectFilter"/>
						</a-form-item>
					</a-col>
					<a-col v-if="link.isNext=='Y'&&(link.toOption=='MU'||link.toOption=='OU')" :span="24">
						<a-form-item label="机构限制" class="index-form-item">
							<a-radio-group v-model:value="link.toOrgOption" :options="dictOptions('flow.model.FlowSectionLink!toOrgOption')"/>
						</a-form-item>
					</a-col>
					<a-col v-if="link.isNext=='Y'&&link.toOrgOption=='Y'&&(link.toOption=='MU'||link.toOption=='OU')" :span="24">
						<a-form-item label="可选机构" class="index-form-item">
							<a-tree-select v-model:value="link.toOrg" :tree-data="dictTreeOptions('manage.model.AdminGroup:C')"  placeholder="请选择可选机构" multiple show-arrow show-search :filterTreeNode="treeSelectFilter"/>
						</a-form-item>
					</a-col>
					<a-col v-if="link.isNext=='Y'&&(link.toOption=='MU'||link.toOption=='OU')" :span="24">
						<a-form-item label="角色限制" class="index-form-item">
						    <a-select v-model:value="link.toRole" :options="dictOptions('manage.model.AdminGroup:B')" placeholder="请选择角色" mode="multiple" show-arrow show-search :filter-option="selectFilter"/>
						</a-form-item>
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			link:{fromSection:{},toOrg:{},toRole:{}},
			nextList:[],
			orgList:[],
			roleList:[]
		};
	},
	mounted(){
		this.link=this.param.link;
		this.nextList=this.param.nextList;
	},
	methods:{
		save:function(){
			this.requestData('action/flow/flowSection/doSaveNext',
				{link:this.link},
				data=>{
					if(!data.code){
						this.$message.success(data.msg);
						this.back(true);
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		},
	}
}